<?php

class TemplatePlugin extends \oxide\plugin\PluginAbstract
{
   public function plug(\oxide\http\Context $context)
   {
      
      $this->register('CommandControllerExecute');
   }
   
   
   public function onCommandControllerExecute($event, $sender, $args)
   {
      if($sender->getModuleName() == 'admin') {
         $browse_link = '';
         $img_src = '/plugin/Template/resource/ico-templet.png';
                  // add new item for image browser
         $span = new oxide\ui\html\Element('a', 
            new oxide\ui\html\Element('img', null, array('src' => $img_src)), 
                 array('href' => $browse_link, 'target' => '_blank' ));
         $span->append('<br/>');
         $span->append('Template');
         _template::navigations($span->render());

      }
   }
}